package bookstudytest.date.newversion;

import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;

/**
 * @Author li.heng
 * @Date 2019/6/25 13
 * @Description:
 **/
public class LocalTimeDemo {


    public static void main(String[] args) {
        getTime("a");
    }

    public static void getTime(String str) {
        // 该实例会生成带有毫秒数的一个LocalTime
        LocalTime now = LocalTime.now();
        // 其参数为，时、分、秒、纳秒
        LocalTime of = LocalTime.of(1, 2, 2, 3);
        LocalTime of1 = LocalTime.of(1, 2, 3);
        System.out.println(of);
    }

    public static void changeTime(String str) {
        LocalTime now = LocalTime.now();
        LocalTime localTime = now.plusHours(1);
        LocalTime localTime1 = now.withMinute(12);
        LocalTime localTime2 = localTime1.withHour(1);
        DateTimeFormatter qweqw = DateTimeFormatter.ofPattern("qweqw");

        String format = localTime2.format(qweqw);
    }
}
